# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Monitoring.V3.Model.Service do
  @moduledoc """
  A Service is a discrete, autonomous, and network-accessible unit, designed to solve an individual concern (Wikipedia (https://en.wikipedia.org/wiki/Service-orientation)). In Cloud Monitoring, a Service acts as the root resource under which operational aspects of the service are accessible.

  ## Attributes

  *   `appEngine` (*type:* `GoogleApi.Monitoring.V3.Model.AppEngine.t`, *default:* `nil`) - Type used for App Engine services.
  *   `basicService` (*type:* `GoogleApi.Monitoring.V3.Model.BasicService.t`, *default:* `nil`) - Message that contains the service type and service labels of this service if it is a basic service. Documentation and examples here (https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli).
  *   `cloudEndpoints` (*type:* `GoogleApi.Monitoring.V3.Model.CloudEndpoints.t`, *default:* `nil`) - Type used for Cloud Endpoints services.
  *   `cloudRun` (*type:* `GoogleApi.Monitoring.V3.Model.CloudRun.t`, *default:* `nil`) - Type used for Cloud Run services.
  *   `clusterIstio` (*type:* `GoogleApi.Monitoring.V3.Model.ClusterIstio.t`, *default:* `nil`) - Type used for Istio services that live in a Kubernetes cluster.
  *   `custom` (*type:* `GoogleApi.Monitoring.V3.Model.Custom.t`, *default:* `nil`) - Custom service type.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Name used for UI elements listing this Service.
  *   `gkeNamespace` (*type:* `GoogleApi.Monitoring.V3.Model.GkeNamespace.t`, *default:* `nil`) - Type used for GKE Namespaces.
  *   `gkeService` (*type:* `GoogleApi.Monitoring.V3.Model.GkeService.t`, *default:* `nil`) - Type used for GKE Services (the Kubernetes concept of a service).
  *   `gkeWorkload` (*type:* `GoogleApi.Monitoring.V3.Model.GkeWorkload.t`, *default:* `nil`) - Type used for GKE Workloads.
  *   `istioCanonicalService` (*type:* `GoogleApi.Monitoring.V3.Model.IstioCanonicalService.t`, *default:* `nil`) - Type used for canonical services scoped to an Istio mesh. Metrics for Istio are documented here (https://istio.io/latest/docs/reference/config/metrics/)
  *   `meshIstio` (*type:* `GoogleApi.Monitoring.V3.Model.MeshIstio.t`, *default:* `nil`) - Type used for Istio services scoped to an Istio mesh.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Resource name for this Service. The format is: projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] 
  *   `telemetry` (*type:* `GoogleApi.Monitoring.V3.Model.Telemetry.t`, *default:* `nil`) - Configuration for how to query telemetry on a Service.
  *   `userLabels` (*type:* `map()`, *default:* `nil`) - Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :appEngine => GoogleApi.Monitoring.V3.Model.AppEngine.t() | nil,
          :basicService => GoogleApi.Monitoring.V3.Model.BasicService.t() | nil,
          :cloudEndpoints => GoogleApi.Monitoring.V3.Model.CloudEndpoints.t() | nil,
          :cloudRun => GoogleApi.Monitoring.V3.Model.CloudRun.t() | nil,
          :clusterIstio => GoogleApi.Monitoring.V3.Model.ClusterIstio.t() | nil,
          :custom => GoogleApi.Monitoring.V3.Model.Custom.t() | nil,
          :displayName => String.t() | nil,
          :gkeNamespace => GoogleApi.Monitoring.V3.Model.GkeNamespace.t() | nil,
          :gkeService => GoogleApi.Monitoring.V3.Model.GkeService.t() | nil,
          :gkeWorkload => GoogleApi.Monitoring.V3.Model.GkeWorkload.t() | nil,
          :istioCanonicalService => GoogleApi.Monitoring.V3.Model.IstioCanonicalService.t() | nil,
          :meshIstio => GoogleApi.Monitoring.V3.Model.MeshIstio.t() | nil,
          :name => String.t() | nil,
          :telemetry => GoogleApi.Monitoring.V3.Model.Telemetry.t() | nil,
          :userLabels => map() | nil
        }

  field(:appEngine, as: GoogleApi.Monitoring.V3.Model.AppEngine)
  field(:basicService, as: GoogleApi.Monitoring.V3.Model.BasicService)
  field(:cloudEndpoints, as: GoogleApi.Monitoring.V3.Model.CloudEndpoints)
  field(:cloudRun, as: GoogleApi.Monitoring.V3.Model.CloudRun)
  field(:clusterIstio, as: GoogleApi.Monitoring.V3.Model.ClusterIstio)
  field(:custom, as: GoogleApi.Monitoring.V3.Model.Custom)
  field(:displayName)
  field(:gkeNamespace, as: GoogleApi.Monitoring.V3.Model.GkeNamespace)
  field(:gkeService, as: GoogleApi.Monitoring.V3.Model.GkeService)
  field(:gkeWorkload, as: GoogleApi.Monitoring.V3.Model.GkeWorkload)
  field(:istioCanonicalService, as: GoogleApi.Monitoring.V3.Model.IstioCanonicalService)
  field(:meshIstio, as: GoogleApi.Monitoring.V3.Model.MeshIstio)
  field(:name)
  field(:telemetry, as: GoogleApi.Monitoring.V3.Model.Telemetry)
  field(:userLabels, type: :map)
end

defimpl Poison.Decoder, for: GoogleApi.Monitoring.V3.Model.Service do
  def decode(value, options) do
    GoogleApi.Monitoring.V3.Model.Service.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Monitoring.V3.Model.Service do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
